home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1987 March / 1987-03.d64 / sprite demo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  1KB  |  29 lines

  1. 1 print"[147]working":forad=832to959:pokead,0:next:q=255
  2. 2 print".";:readn
  3. 3 ifn>qthenad=n:goto2
  4. 4 pokead,n:ifad<879thenpokead+64,n
  5. 5 ad=ad+1:ifn<>240then2
  6. 6 data842,48,0,255,239,252,0,48,0,0,252,0,3,187,0,3,187,0,3,187,0,15,187
  7. 7 data192,2,254,0,3,171,0,0,204,0,0,204,0,0,204,0,0,204,0,0,204,0,3,207
  8. 8 data0,12,204,192,12,0,192,902,12,0,192,51,51,48,192,220,12,918,119,921,119
  9. 9 data0,15,119,192,1,253,0,3,87,0,0,252,938,3,3,944,63,207,240
  10. 10 p=256:v=53248:poke v+32,0:poke v+33,0:printchr$(147):pokev+21,1:poke646,6
  11. 25 b$=chr$(184):fori=1to4:b$=b$+b$:next:m$(0)=b$:m$(4)=m$(0):n=1
  12. 30 m$(1)="the sprite will":m$(2)="pass under these":m$(3)="letters"
  13. 35 m$(5)="above":fori=0to4:printtab(n)m$(i):next:n=n+22:ifn<40then35
  14. 37 fori=0to2:printchr$(145);:next:printtab(n-22+5)m$(5)
  15. 40 xlo=100:x=xlo:xh=0:y=100:dx=1:dy=0:r=29:b=13:c=7:c1=1:c2=2:gosub250
  16. 90 getr$:ifr$=""then102
  17. 100 r=asc(r$):on-(r=81)goto210
  18. 102 on-(r<73orr>77)goto140
  19. 105 dx=-(r=76)+(r=74):dy=-(r=77)+(r=73)
  20. 140 gosub250:b=b+1+(b=14)*2:goto90
  21. 210 poke v+21,0:end
  22. 250 x=x+dx-512*(x=0anddx=-1)+512*(x=511anddx=1):xlo=x+p*(x>q):xh=-(x>q)
  23. 254 y=y+dy-p*(y=0anddy=-1)+p*(y=qanddy=1)
  24. 255 poke v,xlo:poke v+16,xh:c=c-(r=67)+(c=q)*p:poke v+39,c
  25. 256 w=w-(r=88)+p*(w=q):poke v+29,w:h=h-(r=89)+p*(h=q):pokev+23,h
  26. 258 mc=mc-(r=66)+p*(mc=q):poke v+28,mc:c1=c1-(r=49)+p*(c1=q):pokev+37,c1
  27. 260 c2=c2-(r=50)+p*(c2=q):poke v+38,c2:pokev+27,1+(xlo<0orxlo+p*xhi>160)
  28. 262 poke v+1,y:poke2040,b:r=0:return
  29.